Skip to content

Conversation

@mukulpalit-ibm
Copy link
Contributor

Description

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

Copy link
Contributor

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

# Account Check

This module determines whether a given IBM Cloud account is part of an `Enterprise` or is a `Standalone (Normal)` account.
It uses the IBM Cloud Enterprise Management API and can be easily integrated into Terraform configurations via the external data source.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the usage and required permissions here

required_providers {
external = {
source = "hashicorp/external"
version = "2.3.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modules should use a range. EG: >=2.3.5, <3.0.0


# --- Output for Terraform ---
echo "{\"account_type\": \"${ACCOUNT_TYPE}\"}"
exit 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script needs to be updated so the endpoints can be overridden by environment variables, incase someone is using the to deploy to stage for example. See example

source = "./modules/account_check"
target_account_id = local.target_account_id
ibmcloud_api_key = var.ibmcloud_api_key
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output of this has to be used in the restapi_object block as a new parameter. This should also have a count around it as its only needed if CSPM is enabled

# Input Variables
##############################################################################

variable "ibmcloud_api_key" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of added a new required input here, maybe it would be better to get the IAM token using a data lookup in the new submodule and pass the token value directly to the script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants